﻿@model VisaApp.Helper.PagedData<VisaApp.Models.ThongtinhuuichModel>
@{ VisaApp.Helper.StringHelpers nameurl = new VisaApp.Helper.StringHelpers();}

<script type="text/javascript">
    $(document).ready(function () {
        $(".page-number").live("click", function () {
            var page = parseInt($(this).html());
            $.get("/News/LisstThongtinHuuich?regioncode=" + @ViewBag.regioncode   + "&id=" +  @ViewBag.id  + "&page=" + page , function (data) {
                $(".FromListThongtinCanbiet").html("");
                $(".FromListThongtinCanbiet").html(data);
            });
        });
    });

</script>

<table width="100%">
    @if (Model.Data != null)
    {
        <tbody>
            @{ int i = 1;
    }
            @foreach (var item in Model.Data)
            {
                string nameClass = "TrLe";
                if (i % 2 == 0)
                {
                    nameClass = "TrChan";
                }
                <tr class="@nameClass">
                    <td>
                        <div class="infothongtinhi">
                            <p>
                                <a class="aTtHuDetails" href="/thong-tin-huu-ich/@nameurl.RemoveSign4VietnameseString(item.Name)/@item.Id">@item.Name</a></p>
                            <div class="lead">
                                @Html.Raw(item.Description)
                            </div>
                        </div>
                    </td>
                </tr>
                i++;
            }
        </tbody>
    }
    <tfoot>
        <tr class="firstlast">
            <td>
            <div class="PageNav">
                <span class="pageNavHeader">Trang @Model.CurrentPage / @Model.NumberOfPages</span>
                @for (int m = 1; m <= Model.NumberOfPages; m++)
                {
                    if (m == Model.CurrentPage)
                    {
                    <a class="currentPage" href="javascript:void(0);">@m</a>
                    }
                    else
                    {
                    <a class="page-number" href="javascript:void(0);">@m</a>
                    }
                }
                <a href="javascript:void(0)" class="text">Sau &gt;</a>
                </div>
            </td>
        </tr>
    </tfoot>
</table>
